package com.spbdx.studyspringboot.duty_chain.config;

import com.spbdx.studyspringboot.duty_chain.chain.IHandler;
import com.spbdx.studyspringboot.duty_chain.entity.Product;
import com.spbdx.studyspringboot.duty_chain.temp.ProductChainSpringFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.List;

/**
 * @Author: fan
 * @CreateTime 2025/1/1 22:11
 * @Description
 * @Version 1.0
 */
@Configuration
public class MyConfig {


    @Bean
    public ProductChainSpringFactory productChainSpringFactory(List<IHandler<Product,Boolean>> handlers){

        return new ProductChainSpringFactory(handlers);
    }

    @Bean
    public ProductChainSpringFactory fanProductChainSpringFactory(List<IHandler<Object,Boolean>> handlers){

        return new ProductChainSpringFactory(handlers);
    }

}
